<?php

namespace app\store\service\wxapp;

use app\common\library\wechat\WxUser;
use app\common\service\BaseService;

/**
 * 推送模板消息服务类
 * Class Message
 * @package app\store\service\wxapp
 */
class User extends BaseService {
	// 分割符号
	const SEPARATOR = ',';

	/** @var array $stateSet 状态集 */
	private $stateSet = [];

	/** @var WxTplMsg $WxTplMsg 微信模板消息类 */
	private $WxUser;

	/**
	 * 构造方法
	 * Message constructor.
	 * @throws \app\common\exception\BaseException
	 * @throws \think\exception\DbException
	 */
	public function __construct() {
		// 实例化：微信模板消息类，公众号密钥

		$app_id = 'wx5e91f8054325bf08';
		$app_secret = 'fbe20685ae2307a9c09a520cdb902887';
		$this->WxUser = new WxUser($app_id, $app_secret);
	}
	public function getTags() {

		$result = $this->WxUser->getTags();
		return $result;
	}
	public function getTagUser($tagId) {

		$result = $this->WxUser->getTagUser($tagId);
		return $result;
	}
	/**
	 * @param $data
	 * @return bool
	 * @throws \app\common\exception\BaseException
	 * @throws \think\exception\DbException
	 */
	public function getUser($openid) {

		$result = $this->WxUser->getUser($openid);
		return $result;
	}
	public function getUnionid($openid) {

		$result = $this->WxUser->getUnionid($openid);
		return $result;
	}

}